package com.aischool.eduorg.api;

import java.util.List;

import com.aischool.routes.RouteMapping;
import com.aischool.service.WelcomeService;
import com.aischool.utils.DateUtil;
import com.aischool.utils.JsonResult;
import com.jfinal.aop.Inject;
import com.jfinal.plugin.activerecord.Record;

import io.undertow.Version;

@RouteMapping(url = "/api/eduorg/welcome")
public class EduWelcomeController extends BaseApiEduorgController {


	@Inject
	WelcomeService welcomeService;
	
	public void getCount() {
		// 结果类
		JsonResult jr = new JsonResult();
		
		int login_org_id = this.getAttrForInt("login_org_id");
		
		List<Record> list_rd = welcomeService.getEduCount(login_org_id);
		jr.setDicKV("list_rd", list_rd);
		
		String serverInfo = "undertow " + Version.getVersionString() + ","
				+ getRequest().getLocalAddr() +","
				+ getRequest().getServerName() +","
				+ "jvm " + System.getProperty("java.version")+","
						+ "POSTGRESQL 11," + DateUtil.getNowDate("yyyy-MM-dd hh:mm");
		jr.setDicKV("serverInfo", serverInfo);
		
		renderJson(jr.Dic);
	}
}
